class Solution {
public:
    int differenceOfSums(int n, int m) {
        int sumn = 0, summ = 0;
        for (int i = 1; i <= n; ++i)
        {
            if (i % m == 0) summ += i;
            else sumn += i;
        }
        return sumn - summ;
    }
};

class Solution {
public:
    int minOperations(vector<int>& nums, int k)
    {
        sort(nums.begin(), nums.end());
        int left = 0, right = nums.size() - 1;
        while (left < right)
        {
            int mid = left + (right - left) / 2;
            if (nums[mid] < k) left = mid + 1;
            else right = mid;
        }
        return left;
    }
};

class Solution {
public:
    vector<int> findWordsContaining(vector<string>& words, char x)
    {
        vector<int> ret;
        for (int i = 0; i < words.size(); ++i)
        {
            for (int j = 0; j < words[i].size(); ++j)
            {
                if (words[i][j] == x)
                {
                    ret.push_back(i);
                    break;
                }
            }
        }
        return ret;
    }
};
